[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
    QTAwk has integrated arrays into used-defined functions so that  arrays
    may be passed  to used-defined functions  and returned by  user-defined
    functions.

    Normally parameters  are passed  to user-defined  functions "by value",
    i.e., if in invoking a  user-defined function one of the  parameters to
    be passed is a variable, normally the variable itself is not passed but
    a copy  of the  variable is  made, the  variable "value",  and this  is
    passed to the function.

    Arrays  are  passed  to  user-defined  functions  under  the  following
    conditions:

    1) the  argument to  be passed  is a  global or  local and  an array at
       function invokation.

    2) the argument is a global or local variable and used as array in  the
       function, i.e., indexed or operated  on by the "in" operator.   This
       is true  whether the  variable was  an array  or scalar  at function
       invokation.    If  the  refenced  variable  was a scalar at function
       invokation, then  at function  termination, if  the statement(s)  in
       which  the  argument  was  indexed  were  executed,  the  referenced
       variable will be an array with the index values referenced.

    3) the argument is  a global or local  scalar variable and at  function
       termination the argument  is an array.   In this  case, the argument
       may not  have been  directly referenced  as an  array in  the called
       function, but may be the result of an operation involving an  array.
       Alternatively, the argument may have been passed to another function
       which  referenced  it  as  an  array  or  set  it  to  the result of
       operations on arrays.

    Additionally, QTAwk may return  an array as a  return value.  When  the
    return expression  results in  an array,  the entire  array becomes the
    functional return value.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson